var moduleProduct = {
    state:{
        product:[
            {id:1,productName:'vivo X50 Pro',price:4298},
            {id:2,productName:'OPPO Reno4 Pro',price:3799},
            {id:3,productName:'华为 nova 7 Pro',price:3699},
            {id:4,productName:'一加 8 Pro',price:5399},
            {id:5,productName:'OPPO Find Xw Pro',price:5999},
        ]
    },
    getters:{
        productOpen:state =>{
            return state.product.filter(open => open.id=1)
        }
    },
    mutations:{
        increment(state){
            state.product.price += 100  //4398
        },
        ProductNameChange(state,change){
            state.count = change
        }
    },
    action:{
        getProductName:({commit},token)=>{
            setTimeout(() => {
                console.log('1.5秒后出现')
            }, 1500);
            commit('productNameChange',token)
        }
    }
}

export default moduleProduct